#include<iostream>

using namespace std;


//验证虚函数表存储在虚拟地址空间的哪个区域
class Person 
{
    virtual void buyticket(){cout << "成人-全票" << endl;}
};

class Student : public Person
{
    virtual void buyticket(){cout << "学生-半价"<<endl;}
};

int main()
{
    int a = 0;
    printf("stack:%p\n",&a);
    
    static int b = 10;
    printf("data:%p\n",&b);
    
    int* c = new int;
    printf("heap:%p\n",c);
    
    const char* str = "hello cpp";
    printf("code:%p\n",&str);
    
    Person ps;
    Student st;

    printf("st:%p\n",(int*)&st);
    printf("ps:%p\n",(int*)&ps);

    return 0;
}

